namespace Vanilla



// TIMER
class Timer:
	T as System.Timers.Timer
	
	def constructor (ticks as int, cb as callable(Timer), repeat as bool):
		T = System.Timers.Timer(ticks)
		T.Elapsed += {o as Object, t as System.Timers.ElapsedEventArgs|cb(self)}
		T.AutoReset = repeat
		T.Start()
	
	def constructor (ticks as int, repeat as bool, cb as callable(Timer)):
		self(ticks, cb, repeat)
	
	def constructor (ticks as int, cb as callable(Timer)):
		self(ticks, cb, true)
	
	virtual def Stop ():
		T.Stop()
